package com.woniu.outlet.dao;


import java.util.List;

import com.woniu.outlet.po.UserPo;
import com.woniu.outlet.po.UserPoExample;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserPoMapper {
    long countByExample(UserPoExample example);

    int deleteByExample(UserPoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(UserPo record);

    int insertSelective(UserPo record);

    List<UserPo> selectByExample(UserPoExample example);

    UserPo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") UserPo record, @Param("example") UserPoExample example);

    int updateByExample(@Param("record") UserPo record, @Param("example") UserPoExample example);

    int updateByPrimaryKeySelective(UserPo record);

    int updateByPrimaryKey(UserPo record);

    @Select("select p.percode " +
            "from rbac_perms p inner join rbac_user_perm up on p.id=up.permid " +
            "inner join rbac_user u on u.id=up.userid " +
            "where u.username=#{username}")
    List<String> getPercodeByUsername(String username);

    @Select("select * from rbac_user where username=#{username}")
    List<UserPo> getUserList(String username);
}